﻿using Model.Interfaces;

namespace Model.ModelClasses
{
    public class HomeAddress : AbstractModel, IAddress
    {
        public IStreet Street { get; set; }
        public string Building { get; set; }
        public short? Flat { get; set; }

        public override string  ToString()
        {
            var str = "";
            if (Street.Name.Length == 0) return str;
            str = Street.StreetType + " " + Street.Name;
            if (Building.Length == 0) return str;
            str += " " + Building;
            if (Flat == null) return str;
            return str + " кв. " + Flat;
        }
    }
}